Release 10.1A: OpenEdge Development:
Progress 4GL Reference


Temp-table object handle

A handle to a temp-table object. A temp-table object handle corresponds to an underlying Progress temp-table, which can be static or dynamic. A static temp-table is one you define at compile time with the DEFINE TEMP-TABLE statement. A dynamic temp-table is one you create at run time with the CREATE TEMP-TABLE statement.

Syntax

temp-table-handle [ :attribute | :method ] 

temp-table-handle

An item of type WIDGET-HANDLE representing a handle to a temp-table object.

attribute

An attribute of the temp-table object.

method

A method of the temp-table object.

Attributes

Methods

Example

The following code fragment demonstrates the creation, definition and use of a temp-table object:

DEFINE VARIABLE tth AS HANDLE.
DEFINE VARIABLE bh AS HANDLE.
DEFINE VARIABLE qh AS HANDLE.
DEFINE VARIABLE buf-cust-handle AS HANDLE.

/* get db table handle as usual */
buf-cust-handle = BUFFER customer:HANDLE.
/* create an "empty" undefined temp-table */
CREATE TEMP-TABLE tth.
/* give it customer’s fields and indexes */
tth:CREATE-LIKE(buf-cust-handle).
/* give it a single extra field */
tth:ADD-NEW-FIELD("f1","integer").
/* no more fields or indexes will be added to custx */
tth:TEMP-TABLE-PREPARE("custx").
/* get the buffer handle for the temp-table */
bh = tth:DEFAULT-BUFFER-HANDLE.
/*populate the table from customer table */
FOR EACH customer:
    bh:BUFFER-CREATE.
    bh:BUFFER-COPY(buf-cust-handle).
END.
/*run a query to access it*/
CREATE QUERY qh.
qh:SET-BUFFERS(bh).
qh:QUERY-PREPARE("for each custx where . . .").
. . . 

Notes

See also

Buffer object handle, CREATE TEMP-TABLE statement, DEFINE TEMP-TABLE statement, ProDataSet object handle


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095